Skip to content

improvement(settings): react-doctor perf & correctness pass#5327

Merged
waleedlatif1 merged 2 commits into
stagingfrom
settings-react-doctor-perf
Jul 1, 2026
Merged

improvement(settings): react-doctor perf & correctness pass#5327
waleedlatif1 merged 2 commits into
stagingfrom
settings-react-doctor-perf

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Ran react-doctor on the settings surface and fixed the genuine, behavior-preserving findings (score 54 → 57; errors 4 → 2; diagnostics 117 → 72). No hacky/cargo-cult changes.

  • Perf: combined multi-pass array iterations into single passes (api-keys, credential-sets, secrets-manager, team-management); cached/hoisted Intl formatters to module scope (billing); hoisted pure functions + inline-default constants; immutable in-place sort where the array is already a fresh copy
  • Fewer re-renders: stabilized React-Query array fallbacks (?? EMPTY) so downstream useMemos stop recomputing while loading (api-keys, byok, workflow-mcp)
  • Correctness: create-workflow-mcp modal now resets via a render-phase prevOpen compare instead of a state-adjusting effect (removes a stale-flash); genuine exhaustive-deps fixes (v5-stable mutateAsync)
  • Accessibility: aria-labels on real inputs, aria-hidden on autofill decoys, native <button> for clickable rows (inbox task row, profile-picture control)

Deliberately not done (would be hacky or out-of-scope): component splits (no-giant-component) and useReducer refactors; "fixing" barrel imports (repo mandates barrels) or design-system JSX-as-prop; parallelizing a sequential invite loop (changes partial-failure semantics); array-index→id key change (data-model change, deferred).

Type of Change

  • Improvement

Testing

Tested manually. tsc --noEmit clean, biome clean across the surface. react-doctor re-run confirms the reductions above.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

- combine multi-pass array iterations into single passes (api-keys, credential-sets, secrets-manager, team-management)
- cache/hoist Intl formatters to module scope (billing); hoist pure functions and inline-default constants
- stabilize react-query array fallbacks so memos stop recomputing while loading (api-keys, byok, workflow-mcp)
- fix create-workflow-mcp modal reset via render-phase prevOpen compare instead of a state-adjusting effect
- accessibility: aria-labels on real inputs, aria-hidden on autofill decoys, native <button> for clickable rows
- immutable in-place sort where the array is already a fresh copy
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 1, 2026 6:38pm

Request Review

@cursor

cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only refactors and memoization in settings; no auth, billing API, or data-model changes. The modal reset pattern is a localized React correctness tweak with low blast radius.

Overview
Behavior-preserving react-doctor cleanup across workspace settings: fewer unnecessary re-renders, lighter list/filter work, and small a11y fixes—no feature or API changes.

Performance: Query fallbacks now use stable empty constants (?? EMPTY_*) so useMemo chains don’t invalidate while data is loading (API keys, BYOK, workflow MCP, org invite modal). Search/filter paths use single-pass loops instead of map+filter (API keys, credential sets, team roster emails, secrets parsing). Billing caches Intl.NumberFormat per currency; usage-limit help text is hoisted as a stable headerAccessory. Recently-deleted sorting uses in-place sort on an already-filtered copy.

Correctness: The create workflow MCP server modal resets form state when opening via a prevOpen render compare instead of a useEffect, avoiding a stale flash. Several inbox/team callbacks add mutateAsync to hook deps for exhaustive-deps compliance.

Accessibility: Autofill decoy fields get aria-hidden; real controls get aria-labels (BYOK search/key, profile photo/name). Clickable inbox task rows and the profile avatar control use native <button> instead of div + keyboard handlers.

Reviewed by Cursor Bugbot for commit eafaab9. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves the settings surface with small performance, correctness, and accessibility updates. The main changes are:

  • Single-pass filtering and grouping in settings lists.
  • Stable empty fallbacks for loading query data.
  • Hoisted formatters, helpers, and static JSX.
  • Render-phase reset for the workflow MCP create modal.
  • Semantic inputs and buttons for settings controls.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/settings/components/inbox/components/inbox-task-list/inbox-task-list.tsx Non-clickable inbox task rows now render as plain rows, while clickable rows remain semantic buttons.

Reviews (2): Last reviewed commit: "fix(settings): render non-clickable inbo..." | Re-trigger Greptile

…utton

Addresses review: a native disabled <button> can inherit browser disabled
styling (dimmed text / lower contrast) on non-navigable task rows. Render an
interactive <button> only when the row is clickable; otherwise a plain <div>
with identical layout — preserving the semantic-button a11y win without the
disabled-state visual regression.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit eafaab9. Configure here.

@waleedlatif1 waleedlatif1 merged commit c957aa2 into staging Jul 1, 2026
17 checks passed
@waleedlatif1 waleedlatif1 deleted the settings-react-doctor-perf branch July 1, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant